package com.jobson.model;

// Generated May 1, 2013 12:14:36 PM by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

/**
 * PhoneNo generated by hbm2java
 */
@Entity
@Table(name = "PhoneNo", catalog = "JobsonTally")
public class PhoneNo implements java.io.Serializable
{

   /**
	 * 
	 */
	private static final long serialVersionUID = -5426632084705884946L;
private Integer id;
   private User user;
   private TypePhone typePhone;
   private int phoneNo;
   private Date modifiedOn;
   private Set<Stock> stocks = new HashSet<Stock>(0);
   private Set<Stock> stocks_1 = new HashSet<Stock>(0);
   
   // Flag indicate if update has to be called for Customer Table table 
   private boolean isUpdated = false;
   
   public void setIsUpdated(boolean aValue) {
	   this.isUpdated = aValue;
}
   
   @Transient
   public boolean getIsUpdated(){
	   return isUpdated;
   }

   public PhoneNo()
   {
   }

   public PhoneNo(TypePhone typePhone, int phoneNo)
   {
      this.typePhone = typePhone;
      this.phoneNo = phoneNo;
   }

   public PhoneNo(User user, TypePhone typePhone, int phoneNo, Date modifiedOn, Set<Stock> stocks, Set<Stock> stocks_1)
   {
      this.user = user;
      this.typePhone = typePhone;
      this.phoneNo = phoneNo;
      this.modifiedOn = modifiedOn;
      this.stocks = stocks;
      this.stocks_1 = stocks_1;
   }

   @Id
   @GeneratedValue(strategy = IDENTITY)
   @Column(name = "ID", unique = true, nullable = false)
   public Integer getId()
   {
      return this.id;
   }

   public void setId(Integer id)
   {
      this.id = id;
   }

   @ManyToOne(fetch = FetchType.LAZY)
   @JoinColumn(name = "ModifiedBy")
   public User getUser()
   {
      return this.user;
   }

   public void setUser(User user)
   {
      this.user = user;
   }

   @ManyToOne(fetch = FetchType.LAZY)
   @JoinColumn(name = "Type", nullable = false)
   public TypePhone getTypePhone()
   {
      return this.typePhone;
   }

   public void setTypePhone(TypePhone typePhone)
   {
      this.typePhone = typePhone;
   }

   @Column(name = "PhoneNo", nullable = false)
   public int getPhoneNo()
   {
      return this.phoneNo;
   }

   public void setPhoneNo(int phoneNo)
   {
      this.phoneNo = phoneNo;
   }

   @Temporal(TemporalType.DATE)
   @Column(name = "ModifiedOn", length = 10)
   public Date getModifiedOn()
   {
      return this.modifiedOn;
   }

   public void setModifiedOn(Date modifiedOn)
   {
      this.modifiedOn = modifiedOn;
   }

   @OneToMany(fetch = FetchType.LAZY, mappedBy = "phoneNo")
   public Set<Stock> getStocks()
   {
      return this.stocks;
   }

   public void setStocks(Set<Stock> stocks)
   {
      this.stocks = stocks;
   }

   @OneToMany(fetch = FetchType.LAZY, mappedBy = "phoneNo")
   public Set<Stock> getStocks_1()
   {
      return this.stocks_1;
   }

   public void setStocks_1(Set<Stock> stocks_1)
   {
      this.stocks_1 = stocks_1;
   }

}
